package com.example.prom.utils;

import java.util.Random;

public class RandomUtil {

    private static Random random = new Random();

    public static boolean randomBool(int boundaryVal, int divNum){
        // 左闭右开,值取不到val,加1是为了让值能取到val
        return (random.nextInt(boundaryVal) + 1) % divNum != 0;
    }

    public static int nextMs(int boundaryVal){
        // 左闭右开,值取不到val
        return (random.nextInt(boundaryVal));
    }

    public static void main(String[] args) {
        while (true){
            System.out.println((random.nextInt(2) + 1) );
        }
    }
}
